package com.proxy.service.impl.cglib;

import com.proxy.service.impl.KeyFactoryService;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * KeyFactoryMI
 *
 * @author 李坤
 * @date 2022/4/17 16:55
 */
public class KeyFactoryMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object delegate, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        KeyFactoryService service = new KeyFactoryService();

        return methodProxy.invoke(service, objects);
    }
}
